/*
 * @Author: zhuxiaoyi
 * @Date: 2023-05-11 15:08:26
 * @LastEditor: zhuxiaoyi
 * @LastEditTime: 2023-12-20 15:17:46
 * @Description: 
 */
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import * as path from 'path';

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    //设置别名
    alias: {
      '@': path.resolve(__dirname, 'src')
    }
  },
  plugins: [vue()],
  server: {
    port: 3000, //启动端口
    hmr: {
      host: "localhost",
      port: 3000,
    },
    // 设置 https 代理
    proxy: {
      "/zyjy-sjy": {
        target: "http://localhost:8090/zyjy-sjy",
        // target: "http://10.70.38.11:8090/zyjy-sjy",
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/zyjy-sjy/, '')
      },
    }
  }
});


